<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<!-- 在p标签上，加上了ref特性，并赋予了id -->
			<p ref="mp" id="aa">这是p标签</p>
			<button type="button" @click="get">获取ref</button>
		</div>
		<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
		<script type="text/javascript">
			new Vue({
				el:'#app',
				methods:{
					get(){
						// 通过this.$refs获取到的是 绑定的元素
						console.log(this.$refs.mp)
					    var a=document.getElementById('aa')
					    console.log(a)
					}
				}
			})
		</script>
	</body>
</html>
